package stringbuffer_;

import java.util.Scanner;

/**
 * @author wly
 * @version V1.0.0
 * @date 2022/12/22 16:37
 */
public class StringBufferExercise02 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        StringBuffer stringBuffer = new StringBuffer(str);
        System.out.println("sb.length = " + stringBuffer.length());
//        System.out.println(stringBuffer);
//        找到小数点的位置，如果有的话
        int index = stringBuffer.indexOf(".");
        int l = 0;
        if (index > 0){
            l = index;
        }else {
            l = str.length();
        }
        while(l > 0){
            int i = l - 3;
            if (i <= 0 )
                break;
            stringBuffer.insert(i, ',');
            l = l - 3;
        }
        System.out.println(stringBuffer);
    }
}
